﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

/// <summary>
/// Summary description for IMessages
/// </summary>
public interface IMessages
{
    /// <summary>
    /// Get list objec Messages of object Users
    /// </summary>
    /// <param name="user">Object Users has messages</param>
    /// <returns>Return list objec Messages</returns>
    List<Messages> GetMessagessOfUser(Users user);

    /// <summary>
    /// Get list objec Messages of object User by date to present
    /// </summary>
    /// <param name="username">Object User has messages</param>
    /// <param name="date">Created date to present</param>
    /// <returns>Return list object Messages</returns>
    List<Messages> GetMessagessOfUserByDate(Users user, DateTime date);

    /// <summary>
    /// Create object Messages
    /// </summary>
    /// <param name="fromUser">User creates and sends message</param>
    /// <param name="toUser">User receive message</param>
    /// <param name="subject">Subject of object Messages</param>
    /// <param name="contents">Content of object Messages</param>
    /// <returns>Return result was created</returns>
    bool CreateMessage(Users fromUser, Users toUser, string subject, string contents);

    /// <summary>
    /// Delete object Messages
    /// </summary>
    /// <param name="message">Message </param>
    /// <returns>Return result was deleted</returns>
    bool DeleteMessage(Messages message);

    /// <summary>
    /// Convert object DataRow to object Messages
    /// </summary>
    /// <param name="dr">Object DataRow from DataTable</param>
    /// <returns>Return object User was converted</returns>
    Messages ConvertObjectDataRowToObjectMessages(DataRow dr);
}